package com.xbongbong.saas.domain.dao;


import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;

import com.xbongbong.saas.domain.entity.ProductStockUpdateEntity;
import com.xbongbong.saas.domain.entity.SmartReplenishmentEntity;
import com.xbongbong.saas.domain.entity.SupplierProductEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface SmartReplenishmentDao {
    Long insert(SmartReplenishmentEntity entity);

    void insertBatch(List<SmartReplenishmentEntity> list);

    SmartReplenishmentEntity getByKey(@Param("key") Long key, @Param("corpid") String corpid);

    Integer update(SmartReplenishmentEntity entity);

    Integer updateBatch(@Param("list") List<SmartReplenishmentEntity> list, @Param("corpid") String corpid);

    List<SmartReplenishmentEntity> findEntitys(@Param("param") Map<String, Object> param);

    Integer getEntitysCount(@Param("param") Map<String, Object> param);

    List<SmartReplenishmentEntity> getEnablePurchasePassage(@Param("param") Map<String, Object> param);

    List<SmartReplenishmentEntity> getEnableMiniStock(@Param("param") Map<String, Object> param);

    List<SmartReplenishmentEntity> getAllEnable(@Param("param") Map<String, Object> param);

    List<SmartReplenishmentEntity> getAllNotEnable(@Param("param") Map<String, Object> param);

    Integer countEnablePurchasePassage(@Param("param") Map<String, Object> param);

    Integer countEnableMiniStock(@Param("param") Map<String, Object> param);

    Integer countAllEnable(@Param("param") Map<String, Object> param);

    Integer countAllNotEnable(@Param("param") Map<String, Object> param);

    SmartReplenishmentEntity getByProducId(@Param("corpid") String corpid,@Param("productId") Long productId);

    void updateStockDB(@Param("list") Collection<ProductStockUpdateEntity> values, @Param("corpid") String corpid);

}